package com.dmzc.stage1.chapter2;

import javafx.scene.chart.AreaChart;

/***
 * 测试构造参数stackSize的影响
 */
public class ThreadConstruction1 {
    public static void main(String[] args) {
        ThreadGroup group=new ThreadGroup("TestGroup");
        Runnable runnable=new Runnable() {
            private final  int MAX=Integer.MAX_VALUE;
            @Override
            public void run() {
                int i=0;
                recurse(i);
            }
            private  void recurse(int i) {
                System.out.println(i);
                if (i<MAX){
                    recurse(i+1);
                }
            }
        };
        Thread thread=new Thread(group,runnable,"Test",10000);
        try {
            Thread.sleep(10000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        thread.start();
    }



}
